<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP '6.jsp' starting page</title>
  </head>
  
  <body>
  
  	<br/>-----------------------c:out标签--------------------------------------<br/>
  	<% 
  		request.setAttribute("data",null);
  	%>
    <c:out value="${data}" escapeXml="true" default="对不起，您要的数据找不着哟！！！"></c:out>
   
   
   <br/>-----------------------c:set标签:向web存数据，向map或bean中存数据--------------------------------------<br/>
    <c:set var="data" value="xxx" scope="page"/>
    ${pageScope.data }
    <% 
    	Map map = new HashMap();
    	request.setAttribute("map",map);
    %>
    <c:set property="data" value="yyyyy" target="${map}"/>
    ${map.data }
    <%--<c:set property="name" value="flx" target="${person}"></c:set>--%>
    
    
    <br/>-----------------------c:if标签--------------------------------------<br/>
    
    <c:if test="${user==null}" var="b" scope="page"></c:if>
    ${b }
    
    <br/>-----------------------foreach标签--------------------------------------<br/>
    
    <c:forEach var="num" begin="1" end="10" step="1">
    	${num }
    </c:forEach>
    
    <% 
    	List list = Arrays.asList("1","2");
    	request.setAttribute("list",list);
    %>
    
    <c:forEach var="index"  begin="0" end="${fn:length(list)}">
    	${list[index] }
    </c:forEach>
    
    
    <br/>-----------------------c:url标签(重点)--------------------------------------<br/>
    <c:url value="/servlet/ServletDemo1" var="servletdemo1">
    	<c:param name="name" value="中国"/>
    	<c:param name="password" value="我是一个"/>
    </c:url>
    <a href="${servletdemo1 }">点点</a>
    
  </body>
</html>
